package com.example.apiservice.client;


import com.example.apiservice.client.fallback.TestClientFallbackFactory;
import com.example.common.domain.Result;
import com.example.common.domain.pojo.Course;
import com.example.common.domain.pojo.CourseOutline;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "teacher-service", fallbackFactory = TestClientFallbackFactory.class,
        url = "http://127.0.0.1:8182")
public interface TestClient {

    @GetMapping("/teachers/getCourseById2/{id}")
    Result<Course> getCourseById(@PathVariable String id);

    @GetMapping("/teachers/test")
    String test();

    @PostMapping("/teachers/TestPost")
    Result<Course> TestPost(@RequestBody Course course);

    @GetMapping("/teachers/getCourseOutline2/{courseId}")
    Result<CourseOutline> getCourseOutline(@PathVariable String courseId);
}
